Skip Headers

Oracle® Objects for OLE C++ Class Library Developer's Guide 10g Release 2 (10.2) Part Number B14308-01 |
Home | Book List | Contents | Index | Master Index | Feedback

# AppendFieldChunk Method

Applies To

ODynaset

Description

This method appends data to a long or long raw field.

Usage

oresult AppendFieldChunk(int index, const void *chunkp, unsigned short numbytes)

oresult AppendFieldChunk(const char *fieldname, const void *chunkp, unsigned short numbytes)

Arguments

Arguments | Description
--- | ---
index | The 0-based index of the field. The index is the position of the field in the SQL query that created the current record set.
fieldname | The name of the field as expressed in the SQL query.
chunkp | A pointer to the data to be appended.
numbytes | The number of bytes from chunkp to be appended.

Remarks

Long and long raw columns in an Oracle database can hold large amounts of data. The AppendFieldChunk method enables you to add data to a long field piecewise. You can add a maximum of 64K at once. Each call to AppendFieldChunk adds data following any other calls. AppendFieldChunk calls must be made while the dynaset is in an editing mode started by either StartEdit, AddNewRecord, or DuplicateRecord. This method is valid only for fields with server types of OTYPE_LONG or OTYPE_LONGRAW.

Return Value

An oresult indicating whether the operation succeeded (OSUCCESS) or not (OFAILURE).

Example

This example adds take an image segmented into several chunks and stores it in the database.

    // we have an open dynaset pictdyn

    // now start editing
    pictdyn.StartEdit();
    // and loop through the chunks of the picture
    int ii;
    for (ii=0; ii<nchunks; ii++)
        pictdyn.AppendFieldChunk("pfield", (const void *) picture[ii], plen[ii]);

    // and save it to the database
    pictdyn.Update();